<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>

<div class="house-type-image-model-index">


    <p>
        <?php if (\backend\components\MenuHelper::checkRoute('create')) {
            echo Html::a('添加户型图', ['create','house_id'=>$house_id], ['class' => 'btn btn-success']);
        } ?>
    </p>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'columns' => [

            ['label' => '图片', 'format' => 'raw', "headerOptions" => ["width" => "240"],  'value' => function ($model) {
                return "<a href='$model->img_path' target='_blank'><img src='{$model->img_path}' style='max-height: 100px; max-width: 100px'></a>" ;
            }],
            'name',
            'house_type',
            'area',
            'price',

            [
                'class' => 'yii\grid\ActionColumn',
                'template' => \backend\components\MenuHelper::filterActionColumn('{update}&nbsp;&nbsp;{delete}')
            ],
        ],
    ]); ?>
</div>
